﻿using System;
using System.Collections;
using mojoPortal.Web.Framework;

namespace ud_MenuHTML
{
    /// <summary>
    /// encapsulates the feature instance configuration loaded from module settings into a more friendly object
    /// </summary>
    public class MenuHTMLConfiguration
    {
        public MenuHTMLConfiguration()
        { }

        public MenuHTMLConfiguration(Hashtable settings)
        {
            LoadSettings(settings);

        }

        private void LoadSettings(Hashtable settings)
        {
            if (settings == null) { throw new ArgumentException("must pass in a hashtable of settings"); }

            if (settings.Contains("CustomCssClassSetting"))
            {
                customCssClass = settings["CustomCssClassSetting"].ToString();
            }
            useArtisteer = WebUtils.ParseBoolFromHashtable(settings, "UseArtisteerSetting", useArtisteer);
            useIconSetting = WebUtils.ParseBoolFromHashtable(settings, "UseIconSetting", useIconSetting);
            if (settings.Contains("HeaderTextSetting"))
            {
                headerText = settings["HeaderTextSetting"].ToString();
            }
            if (settings.Contains("FooterTextSetting"))
            {
                footerText = settings["FooterTextSetting"].ToString();
            }
        }

        private string customCssClass = string.Empty;
        public string CustomCssClass
        {
            get { return customCssClass; }
        }

        private bool useArtisteer;
        public bool UseArtisteer
        {
            get { return useArtisteer; }
        }      
        
        private string headerText = string.Empty;
        public string HeaderText
        {
            get { return headerText; }
        }

        private string footerText = string.Empty;
        public string FooterText
        {
            get { return footerText; }
        }

        private bool useIconSetting;
        public bool UseIconSetting
        { get { return useIconSetting; } }
    }
}